package com.yc.pay.factory;

import com.yc.pay.service.strategy.IStrategyPay;
import com.yc.pay.service.strategy.impl.AlipayQrCodePayImpl;
import com.yc.pay.service.strategy.impl.AlipayWapPayImpl;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 支付方式工厂，生成支付方式。
 */
public class PayWayFactory {

   public static ConcurrentHashMap<String,IStrategyPay> concurrentHashMap = new ConcurrentHashMap<String,IStrategyPay>();

    /**
     * 生成对象的支付方式对象
     * @param payWay
     */
    public static IStrategyPay getPay(String payWay){

        return concurrentHashMap.get(payWay);
    }
}
